# Copyright (C) 2024 The Google Bazel Common Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

module(name = "google_bazel_common",
    version = "0.0.1",
)

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_java", version = "8.6.1")
bazel_dep(name = "rules_jvm_external", version = "6.6")

GUAVA_VERSION = "33.4.0-jre"

AUTO_SERVICE_VERSION = "1.1.1"

AUTO_VALUE_VERSION = "1.10.4"

DAGGER_VERSION = "2.43.2"

ERROR_PRONE_VERSION = "2.22.0"

BYTE_BUDDY_VERSION = "1.14.9"

TRUTH_VERSION = "1.4.4"

GRPC_VERSION = "1.66.0"

CHECKER_FRAMEWORK_VERSION = "2.5.3"

ASM_VERSION = "9.6"

LOG4J2_VERSION = "2.17.2"

INCAP_VERSION = "0.2"

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
    name = "google_bazel_common_maven",
    artifacts = [
        "javax.annotation:jsr250-api:1.0",
        "com.google.code.findbugs:jsr305:3.0.1",
        "javax.inject:javax.inject:1",
        "javax.inject:javax.inject-tck:1",
        "com.google.guava:guava:" + GUAVA_VERSION,
        "com.google.guava:guava-testlib:" + GUAVA_VERSION,
        "com.google.guava:failureaccess:1.0.2",
        "com.google.guava:guava-beta-checker:1.0",
        "com.google.errorprone:javac-shaded:9-dev-r4023-3",
        "com.google.googlejavaformat:google-java-format:1.18.1",
        "com.google.auto:auto-common:1.2.2",
        "com.google.auto.factory:auto-factory:1.0.1",
        "com.google.auto.service:auto-service:" + AUTO_SERVICE_VERSION,
        "com.google.auto.service:auto-service-annotations:" + AUTO_SERVICE_VERSION,
        "com.google.auto.value:auto-value:" + AUTO_VALUE_VERSION,
        "com.google.auto.value:auto-value-annotations:" + AUTO_VALUE_VERSION,
        "com.google.dagger:dagger:" + DAGGER_VERSION,
        "com.google.dagger:dagger-compiler:" + DAGGER_VERSION,
        "com.google.errorprone:error_prone_annotation:" + ERROR_PRONE_VERSION,
        "com.google.errorprone:error_prone_annotations:" + ERROR_PRONE_VERSION,
        "com.google.errorprone:error_prone_check_api:" + ERROR_PRONE_VERSION,
        "junit:junit:4.13.2",
        "com.google.testing.compile:compile-testing:0.21.0",
        "net.bytebuddy:byte-buddy:" + BYTE_BUDDY_VERSION,
        "net.bytebuddy:byte-buddy-agent:" + BYTE_BUDDY_VERSION,
        "org.mockito:mockito-core:5.4.0",
        "org.hamcrest:hamcrest-core:1.3",
        "org.objenesis:objenesis:1.0",
        "com.google.truth:truth:" + TRUTH_VERSION,
        # TODO: b/113905249 - Remove this: All its contents have moved into `truth`.
        "com.google.truth.extensions:truth-java8-extension:" + TRUTH_VERSION,
        "com.google.truth.extensions:truth-proto-extension:" + TRUTH_VERSION,
        "com.squareup:javapoet:1.13.0",
        "io.grpc:grpc-api:" + GRPC_VERSION,
        "io.grpc:grpc-core:" + GRPC_VERSION,
        "io.grpc:grpc-netty:" + GRPC_VERSION,
        "io.grpc:grpc-context:" + GRPC_VERSION,
        "io.grpc:grpc-protobuf:" + GRPC_VERSION,
        "io.grpc:grpc-stub:" + GRPC_VERSION,
        "io.grpc:grpc-all:" + GRPC_VERSION,
        "com.google.protobuf:protobuf-java:3.24.4",
        "org.checkerframework:checker-compat-qual:" + CHECKER_FRAMEWORK_VERSION,
        "org.checkerframework:checker-qual:" + CHECKER_FRAMEWORK_VERSION,
        "org.checkerframework:javacutil:" + CHECKER_FRAMEWORK_VERSION,
        "org.checkerframework:dataflow:" + CHECKER_FRAMEWORK_VERSION,
        "org.jspecify:jspecify:1.0.0",
        "org.ow2.asm:asm:" + ASM_VERSION,
        "org.ow2.asm:asm-tree:" + ASM_VERSION,
        "org.ow2.asm:asm-commons:" + ASM_VERSION,
        "org.codehaus.plexus:plexus-utils:3.0.20",
        "org.codehaus.plexus:plexus-classworlds:2.5.2",
        "org.codehaus.plexus:plexus-component-annotations:1.5.5",
        "org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.0",
        "org.eclipse.sisu:org.eclipse.sisu.inject:0.3.0",
        "org.apache.maven:maven-artifact:3.3.3",
        "org.apache.maven:maven-model:3.3.3",
        "org.apache.maven:maven-plugin-api:3.3.3",
        "javax.enterprise:cdi-api:1.0",
        "org.pantsbuild:jarjar:1.7.2",
        "org.apache.ant:ant:1.9.6",
        "org.apache.ant:ant-launcher:1.9.6",
        "log4j:log4j:1.2.15",
        "org.apache.logging.log4j:log4j-api:" + LOG4J2_VERSION,
        "org.apache.logging.log4j:log4j-core:" + LOG4J2_VERSION,
        "org.apache.bcel:bcel:6.7.0",
        "com.googlecode.java-diff-utils:diffutils:1.3.0",
        "org.slf4j:slf4j-api:1.7.14",
        "net.ltgt.gradle.incap:incap:" + INCAP_VERSION,
        "net.ltgt.gradle.incap:incap-processor:" + INCAP_VERSION,
        "com.google.common.inject:inject-common:1.0",
    ],
    fail_if_repin_required = True,
    lock_file = "//:maven_install.json",
    repositories = [
        "https://bazel-mirror.storage.googleapis.com/repo1.maven.org/maven2/",
        "https://repo1.maven.org/maven2/",
        "http://maven.ibiblio.org/maven2/",  # link seems to be dead?
    ],
    strict_visibility = True,
)
use_repo(maven, "google_bazel_common_maven")
